#pragma once

#ifdef WGLENGINE_DLL
#define WGLENGINE_EXPORT __declspec(dllexport)
#else
#define WGLENGINE_EXPORT __declspec(dllimport)
#endif

#include "WObject.h"
#include "InputListener.h"

#include <memory>

class WGLENGINE_EXPORT Camera : public WObject, public InputListener
{
public:
	Camera() {
		viewMatrix = glm::inverse(transform->GetModelMatrix());
	}
	
	~Camera() {
		transform.release();
	}

	void SetMatrix(glm::mat4 matrix) {
		transform->SetModelMatrix(matrix);
	}

	virtual glm::vec3 GetPosition() = 0;

	glm::mat4 GetCameraMatrix() {
		return transform->GetModelMatrix();
	}

	glm::mat4 GetViewMatrix() {
		UpdateCameraMatrix();
		return viewMatrix;
	}
	
	virtual void Update() = 0;
	virtual void ProcessInputQueue() = 0;

protected:	
	virtual void UpdateCameraMatrix() = 0;
	virtual void UpdateCamera() = 0;

	glm::mat4 viewMatrix;

};